Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add features in get-dependent-files.ts #1525

Merged
merged 1 commit into from
Aug 10, 2016

Conversation

ashoktamang
Copy link
Contributor

add logic to filter out spec file associated with the given component unit and all index files while getting all dependent files
add utlity function to get all the files (.html/stylesheets/.spec.ts) associated with the given component unit
change the constructor method of the class ModuleResolver (add 'rootPath' as an additional parameter)

let fileBaseName = path.basename(fileName, '.ts');
return files
.filter((file) => {
if (path.extname(path.basename(file, '.ts')) === '.spec') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that getDependentFiles shouldn't lie to you. Return the spec here as well, and filter it out when you're actually using it.

@ashoktamang ashoktamang force-pushed the dependent-files branch 6 times, most recently from 4b8f613 to cd02683 Compare August 8, 2016 17:13
* @return absolute paths of '.html/.css/.sass/.spec.ts' files associated with the given file.
*
*/
export function getAllCorrespondingFiles(fileName: string): Promise<string[]> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we validate in here that the file is actually a .component file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests for this function?

@alxhub
Copy link
Member

alxhub commented Aug 8, 2016

LGTM pending 2 comments.

@ashoktamang ashoktamang force-pushed the dependent-files branch 2 times, most recently from 52bd322 to 823e53e Compare August 8, 2016 22:18
@@ -75,6 +75,35 @@ export function hasIndexFile(dirPath: string): Promise<Boolean> {
}

/**
* Function to get all the templates, stylesheets, and spec files of a given component unit
* Assumption: When any component/service/pipe unit is generated, Angular CLI has a blueprint for
* creating associated files with the name of the generated unit. So, there are two
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't indent so far over here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will 2 spaces under 'Assumption: ' do?

@ashoktamang ashoktamang force-pushed the dependent-files branch 4 times, most recently from aaf1d5b to a32f7b9 Compare August 10, 2016 16:16
add logic to filter out spec file associated with the given component unit and all index files while getting all dependent files
add utlity function to get all the files (.html/stylesheets/.spec.ts) associated with the given component unit
change the constructor method of the class ModuleResolver (add 'rootPath' as an additional parameter)
@alxhub alxhub merged commit 7565f2d into angular:master Aug 10, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants